package me.helllp.dake.common.security;

import java.util.Arrays;

public enum AESEnum {
    AES_CBC_PKCS5("AES/CBC/PKCS5Padding"),
    AES_CBC_PKCS7("AES/CBC/PKCS7Padding"),
    AES_CFB_PKCS5("AES/CFB/PKCS5Padding"),
    AES_CFB_PKCS7("AES/CFB/PKCS7Padding"),
    AES_OFB_PKCS5("AES/OFB/PKCS5Padding"),
    AES_OFB_PKCS7("AES/OFB/PKCS7Padding"),
    ;
    private String algName;

    AESEnum(String algName) {
        this.algName = algName;
    }

    public String getAlgName() {
        return algName;
    }

    public static AESEnum parser(String algorithm) {
        for (AESEnum aes: AESEnum.values()) {
            if (aes.algName.equals(algorithm)) {
                return aes;
            }
        }
        return null;
    }
}
